float4x4 World;
float4x4 View;
float4x4 Projection;
float4 FilterColor;
float Light;
texture Texture1;

sampler TextureSampler = sampler_state 
						{
							texture = <Texture1>; 
							magfilter = LINEAR;
							minfilter = LINEAR; 
							mipfilter = LINEAR; 
							AddressU = clamp; 
							AddressV = clamp; 
						};

// TODO: add effect parameters here.

struct VertexShaderTextureInput
{
    float4 Position : POSITION0;	
	float2 TexCoord : TEXCOORD0;
	//float4 Filter : POSITION1;

    // TODO: add input channels such as texture
    // coordinates and vertex colors here.
};

struct VertexShaderTextureOutput
{
    float4 Position : POSITION0;
	float2 TexCoord : TEXCOORD0;
	float4 Passer : COLOR0;

    // TODO: add vertex shader outputs such as colors and texture
    // coordinates here. These values will automatically be interpolated
    // over the triangle, and provided as input to your pixel shader.
};

//------------------------------------------------------------------------------

VertexShaderTextureOutput VertexShaderFunction2(VertexShaderTextureInput input)
{
    VertexShaderTextureOutput output;

    float4 worldPosition = mul(input.Position, World);
    float4 viewPosition = mul(worldPosition, View);
    output.Position = mul(viewPosition, Projection);
	output.TexCoord = input.TexCoord;
	
	
	output.Passer = FilterColor;
	//output.Passer.a =Light;
    // TODO: add your vertex shader code here.

    return output;
}

float4 PixelShaderFunction2(VertexShaderTextureOutput input) : COLOR0
{
    // TODO: add your pixel shader code here.
	float4 FilterColor = input.Passer;
	//float Light = FilterColor.a;
	//FilterColor.a = 1;
	float4 Color = tex2D(TextureSampler, input.TexCoord);
	
	/*if(Color.r ==  0 && Color.g == 0 && Color.b == 0){
		Color.a = 0;
	}*/
	Color = Color*FilterColor;
	return Color;
}

technique Technique2
{
    pass Pass1
    {
        // TODO: set renderstates here.

		AlphaBlendEnable = TRUE;
        DestBlend = INVSRCALPHA;
        SrcBlend = SRCALPHA;

        VertexShader = compile vs_1_1 VertexShaderFunction2();
        PixelShader = compile ps_2_0 PixelShaderFunction2();
    }
}

//--------------------------
struct VertexShaderInput
{
    float4 Position : POSITION0;

    // TODO: add input channels such as texture
    // coordinates and vertex colors here.
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;

    // TODO: add vertex shader outputs such as colors and texture
    // coordinates here. These values will automatically be interpolated
    // over the triangle, and provided as input to your pixel shader.
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;

    float4 worldPosition = mul(input.Position, World);
    float4 viewPosition = mul(worldPosition, View);
    output.Position = mul(viewPosition, Projection);

    // TODO: add your vertex shader code here.

    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
    // TODO: add your pixel shader code here.

    return float4(1, 0, 0, 1);
}

technique Technique1
{
    pass Pass1
    {
        // TODO: set renderstates here.

        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}